module.exports = function ($scope, $resource, toaster){
    
    $scope.colors = [];

    $resource('/api/ac/goc/dataAnalysisService/singleData', {}, {}).save({'type':'9'}, function (res) {
        console.log(res);

        if (res.errcode !== 0) {
            toaster.error({title: '', body: res.errmsg});
            return;
        }

        $scope.labels = res.data.labels;
        $scope.data = res.data.data;
        for(var i in res.data.labels) {
            $scope.colors.push("#5bc0de");
        }

    });

};